High frequency divider state correction circuit

ABSTRACT

The present invention provides for a self-correcting state circuit. A first flip flop is configured to receive a clock input and a first data input, and to generate a first output in response to the clock input and the first data input. A second flip flop is coupled to the first flip flop and configured to receive the clock input and to receive the first output as a second data input, and to generate a second output in response to the clock input and the first output. A first correction circuit is coupled to the second flip flop and configured to generate a corrected output. A third flip flop is coupled to the first correction circuit and configured to receive the clock input and to receive the corrected output as a third data input, and to generate a third output in response to the clock input and the third data input.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a division of, and claims the benefit of the filingdate of, co-pending U.S. patent application Ser. No. 11/467,972 entitledHIGH FREQUENCY DIVIDER STATE CORRECTION CIRCUIT, filed Aug. 29, 2006,which is a division of U.S. patent application Ser. No. 10/850,400entitled HIGH FREQUENCY DIVIDER STATE CORRECTION CIRCUIT, now U.S. Pat.No. 7,119,587 filed May 20, 2004. This application relates to U.S.patent application Ser. No. 10/850,402 entitled HIGH FREQUENCY DIVIDERSTATE CORRECTION CIRCUIT WITH DATA PATH CORRECTION, now U.S. Pat. No.7,061,284, filed May 20, 2004.

TECHNICAL FIELD

The present invention relates generally to error correction and, moreparticularly, to error correction in a state machine circuit.

BACKGROUND

There is a type of incrementer called a high frequency divider. In ahigh frequency divider, the values within the incrementer change in apredefined fashion, but not necessarily by a mathematical addition orsubtraction. For example, 000000 could be the first state, 000001 couldbe the second state, 000011 could be the third, 000111 could be thefourth, 001111 could be the fifth, 011111 could be the sixth, 111111could be the seventh, 011111 could be the eighth state, and so on. Thevalues could represent the generation of a square wave, although otheruses are also possible. The particular transition from state value tostate value is a function of the internal logic of the high frequencydivider.

However, there is a problem with typical high frequency dividers. Onesuch problem is if the system starts up in an invalid state. In theexample above, for instance, the state 010101 is not a desired state,but is physically accessible at start up. This can happen when a systemfirst powers up, as the states of the latches within the system can beindeterminate. Alternatively, a catastrophic event, such as anelectromagnetic pulse, for example, can disrupt the latches or othersystem components. If this happens, the high frequency divider can beforced into an undesired state.

Moreover, if left uncorrected in conventional systems, the states couldcycle from one undesired state to another undesired state, without everbecoming a desired state and getting back on track. In some conventionalsystems, the system can be reset, and a preloaded “seed” state can beentered into the system. However, this is an expensive proposition,time-wise, and errors can creep in if the initial “seed” state issomehow inaccurate. Further, if an electromagnetic pulse changes thestate within the circuit to an invalid state or sequence, this invalidstate or sequence should be deleted, which costs additional time andcircuitry area, and a system reset is issued, which also costsadditional time.

Therefore, there is a need to ensure that a desired state is arrived atafter a certain number of state transitions in a manner that addressesat least some of the problems associated with the prior art.

SUMMARY OF THE INVENTION

The present invention provides for a self-correcting state circuit. Afirst flip flop is configured to receive a clock input and a first datainput, and to generate a first output in response to the clock input andthe first data input. A second flip flop is coupled to the first flipflop and configured to receive the clock input and to receive the firstoutput as a second data input, and to generate a second output inresponse to the clock input and the first output. A first correctioncircuit is coupled to the second flip flop and configured to generate acorrected output. A third flip flop is coupled to the first correctioncircuit and configured to receive the clock input and to receive thecorrected output as a third data input, and to generate a third outputin response to the clock input and the third data input.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present invention, and theadvantages thereof, reference is now made to the following DetailedDescription taken in conjunction with the accompanying drawings, inwhich:

FIG. 1A schematically depicts an allowed and an unallowed divide by 8stateflow;

FIG. 1B schematically depicts an allowed and an unallowed divide by 6stateflow;

FIG. 2 illustrates a divide by 8 stateflow correction circuit with statecorrection;

FIG. 3 illustrates a conventional D flip flop;

FIG. 4 illustrates a D flip flop configured for error correction;

FIG. 5 illustrates an alternative embodiment of a divider circuit; and

FIG. 6 illustrates various timing diagrams of external and internalstate values of the flip flops of FIG. 2.

DETAILED DESCRIPTION

In the following discussion, numerous specific details are set forth toprovide a thorough understanding of the present invention. However,those skilled in the art will appreciate that the present invention maybe practiced without such specific details. In other instances,well-known elements have been illustrated in schematic or block diagramform in order not to obscure the present invention in unnecessarydetail. Additionally, for the most part, details concerning networkcommunications, electromagnetic signaling techniques, and the like, havebeen omitted inasmuch as such details are not considered necessary toobtain a complete understanding of the present invention, and areconsidered to be within the understanding of persons of ordinary skillin the relevant art.

In the remainder of this description, a processing unit (PU) may be asole processor of computations in a device. In such a situation, the PUis typically referred to as an MPU (main processing unit). Theprocessing unit may also be one of many processing units that share thecomputational load according to some methodology or algorithm developedfor a given computational device. For the remainder of this description,all references to processors shall use the term MPU whether the MPU isthe sole computational element in the device or whether the MPU issharing the computational element with other MPUs, unless otherwiseindicated.

It is further noted that, unless indicated otherwise, all functionsdescribed herein may be performed in either hardware or software, orsome combination thereof. In a preferred embodiment, however, thefunctions are performed by a processor, such as a computer or anelectronic data processor, in accordance with code, such as computerprogram code, software, and/or integrated circuits that are coded toperform such functions, unless indicated otherwise.

Turning to FIG. 1A, disclosed is a stateflow diagram illustrating anexemplary stateflow with designated allowed or “desired” and unallowedor “undesired” states. Generally, FIG. 1A illustrates a plurality ofpre-determined desired states following an ordered sequence according toa pre-determined transition rule and a plurality of pre-determinedundesired states following an ordered sequence according to thepre-determined transition rule.

In FIG. 1A, an unallowed stateflow transitions into an allowed stateflowafter one of a plurality of specifically defined states or a set ofstates occurs. That is, one or more of the undesired states are selectedand correlated to one or more of the desired states. Generally, as shownin FIG. 1A, a specifically defined non-allowed state is detected, suchas 00110011 or 00110000, and an internal change of a value occurs withinthe high frequency divider circuit, thereby initiating a state changeinto a particular desired state, such as 00000001 or 10000000. In aconventional system, the detected non-allowed state would transition to,for example, 00011001 or 10011000.

For example, assume the undesired state “01100111” arose at power up,using conventional technology. By the internal logic of the circuitry (ashift right, or bitwise right circular shift, and then invert the valueshifted from the rightmost bit and wrapped around the to the leftmostbit), “01100111” would transition to “00110011”, which is anotherunallowed state. Similarly, “00110011” would transition to “00011001”,also another unallowed state, and so forth. The present invention, asillustrated through the transition diagram of FIG. 1A, addresses thisproblem.

Turning now to FIG. 1B, disclosed is a stateflow diagram illustrating a“divide by 6” stateflow with designated allowed or “desired” andunallowed or “undesired” states. An undesired state transitions into anallowed state from a specifically defined undesired state. Generally, asshown in FIG. 1B, the particular specifically defined undesired state is“001100”, from which a circuit transitions to the allowed state“100000”. In conventional technology, the circuit would transition from“001100” to “100110”, which is another undesired state.

Turning now to FIG. 2, illustrated is a divide by 8 state circuit 200. AD type flip flop (DFF) 1 215 has a clock signal input into its C inputfrom a clock source 235. The Q output of DFF1 215 (q1 signal state) iscoupled to the D input (the data input) of a DFF2 220. The Q output ofDFF2 220 (q2 signal state) is coupled to the D input of a DFF3 225. TheQ output of DFF3 225 (q3 signal state) is coupled to the D input of aDFF4 230. The Q-inverted output (QB) of DFF4 230 (q4 signal state) isfed back into and coupled to the D input of DFF1 215.

The Q states of DFF1 215, DFF2 220, DFF3 225, and DFF4 230 are coupledto a logical operator 1 210. The logical operator 1 210 is coupled to agate of the DFF2 220. In other implementations, only flip flops 215,220, and 225 are used. In the illustrated embodiment, logical operator 1210 is coupled to DFF2 220 through Gate Memory 205. As shown, GateMemory 205 is configured to introduce a time delay, which helps preventproblems with substantially simultaneous feedback, which could cause thelogic states not to converge, an error condition. The illustratedconfiguration supports the state transition from the undesired states todesired states of FIG. 1A.

Turning now to FIG. 3, depicted is a system illustrating conventionalD-type flip flops, such as DFF1 215, DDF3 225, and DFF4 230 of FIG. 2,for example, generally indicated by the reference numeral 300. Flipflops have applicability as memory devices. In the illustrated system,there are two inputs for the flip flop, input 1 (D, for data input) andinput 2 (C, for a clock input). The flip flops DFF1 215, DFF3 225, andDFF4 230 shown in FIG. 2 are depicted in greater detail in FIG. 3, andare comprised of 2 different latches, 310 and 320. Flip flop DFF2 220will be described in greater detail below with respect to FIG. 4.

As is understood by those of skill in the art, if a flip flop is enabledby a clock signal, the flip flop will pass on the signal data state fromthe input to the output on the data, or Q line. However, if the flipflop is disabled by a clock signal, the input D value will not bepropagated to the output, and instead the previously stored D value willbe output.

As illustrated in FIG. 3, there are two D-type latches coupled inseries, latch 310 and latch 320. If the input value for D is 1, and theclock value is enabled, the qint value is also the same as the D value,and the qintb value is the inverted value of qint. However, due to alogical “not” operator 330, the second D latch 320 is disabled. Thismeans that, no matter what the qint value is in this circuit, theprevious qint value is what is output as the Q value (as output 3). Inother words, when the clock is “high”, the output of system 300 does notchange, as it “remembers” and outputs the previous state.

However, for example, in the next clock pulse, the input clock pulsegoes “low”. Therefore, the input data does not propagate from the Datainput to the Q or qint output in this flip flop, and the qint value ofthe previous clock cycle is retained by this first D latch 310. However,because the input clock value is inverted to “high”, the second flipflop propagated the qint value into the output Q, the “3” value. Hence,for the DFF1 215 to change an output state, it takes at least one fullclock cycle, and it only accepts as input data states from alternatingclock cycles.

Turning back to FIG. 2, this means that, for instance, the values00000011 can be used in the system. On the next clock cycle, the valuebecomes 00000001. As has been explained above, there is an internalstate (qint1, qint2, qint3) etc, which is illustrated as non-underlined,and a state q1, q2, q3 and so on, which is illustrated as underlined.The state changes because the inversion that occurs at the output ofDFF4 230, which is fed back in as data into the D port of the DFF1 215.As is seen by the desired states transition illustrated in FIG. 1A, thestates are stepped through the system, the last flip-flop inverting andtransferring the inverted value back to the input.

However, if an undesired state comes up, the system 200 operates asfollows. For example, consider a scenario wherein a conventional systemstarts as 01100111 as its starting state. A conventional system wouldthen transition to 00110011, also an invalid state. Without correctionthe conventional system would further transition to 00011001.

However, the logic of FIG. 2 is configured to transition to 00000001, anallowed state, instead of 00011001, an non-allowed state. As shown inFIG. 2, the second bit of the state 00xxxxxx, is used to overwrite thenext 3 bits in the state, to become 00000xxx. Similarly, an invalidstate of 00110000 transitions to 10000000 instead of 10011000. In otherwords, the first output state (q1) also becomes q2 internal and q2 outand q3 internal, as illustrated in FIG. 1A.

System 200 detects invalid states as follows. The outputs q1, q2(inverted) and q3 are input into logical operator 1 210. In theillustrated embodiment, logical operator 1 210 is an OR gate. Whenxxxxxxxx (“x” a variable), have the values of x0x1x0xx, the OR gate 210output becomes negative, the output invalid b state goes low, and thereis enabled a transition from an unallowed state to an allowed state.Turning briefly to FIG. 1A, this transition happens at both 00110011 and00110000, as is shown in FIG. 1A, and only in those states does thetransition to a desired state happen.

Turning now to FIG. 4, depicted is a system illustrated a D-type flipflop such as, for example, DFF2 220 of FIG. 2, generally indicated byreference numeral 400. In particular, system 400 includes latches 410,420 of a DFF2 220, the flip flop in which state transitions occur whenthe logical operator 1 210 detects a specified error state condition.The logical operator NOT (the inverter) 330 shown in FIG. 3 is replacedby an XOR (exclusive OR) 430 in FIG. 4. System 400 also receives aninput 3 “gate” input to XOR 430. An XOR, as is understood by those ofskill in the art, gives a true value if both values are different, and afalse value (value of zero) if both input values are the same In thecontext of FIG. 2, this means that the OR output is 0 for a specificpredefined non-allowed state, and 1 for an allowed state or anon-specified non-allowed state. Then, this becomes the “gate” value 3into system 400, the DFF2 220 flip flop. As shown in FIG. 4, when thegate value output by the OR gate 210 is “1”, and the C value input is a“1”, the output value of XOR 430 is a “0”, which means that system 400is behaving like a prior art flip flop, and the XOR is behaving as aninverter. Similarly, if the gate value is “1” and the C value input is a“0”, the output value is a “1”, which means the XOR 430 is behaving asan inverter to the C value.

In FIG. 4, when the gate value is “0”, and the C value input is a “1”,the XOR 430 output value is a “1”, which means that system 400 is notbehaving like a prior art flip flop, and the same value for D is beingpropagated through both D1 latch 1 410 and D Latch 2 420. Similarly, ifthe gate value is “0” and the C value input is a “0”, the XOR 430 outputvalue is a “0”, which is sent as a C input to D Latch 2 420, and theprevious states are stored in D latch 1 410 and D latch 2 420.

In other words, when the output of OR 210, the gate input to XOR 430, iszero, the D latch 1 410 and the D latch 2 420 both have the same clockvalues within DFF2 220. In the context of FIG. 2, this means that wheninput 3 of FIG. 4 is “0”, for a negative clock pulse, the qint valuestill does not change. However, unlike the prior art, the Q output valuedoes not change either. Therefore, the qint and the q value are both“locked,” which is unlike FIG. 3, and the Q output value does notchange.

Furthermore, if the input clock pulse is positive and the gate input iszero, the input D value propagates through both D latches 410, 420,through qint2 and then out through Q. Also, because the clock state ispositive as input into DFF3 225, the qint of the third flip flop q3 intis also equal to q2. In other words, the D value becomes Q, which wasnot true in the prior art.

In other words, for a gate value of 0, and a positive clock cycle, theq1 value gets propagated to the qint2 value and the q2 output value, andthe q3 int value. In the context of FIG. 1A, this means that instead of00110000 becoming the unallowed state of 10011000, it becomes 10000000,thereby forcing the system from an undesired state to a desired state.Likewise, the state after 00110011, which would have been 00011001, isinstead 00000001, as the q1 value gets propagated and copied through toq3 int.

Turning now to FIG. 5, illustrated is an alternative embodiment of adivider circuit, generally indicated by the reference numeral 500. A Dtype flip flop (DFF) 1 510 has a clock signal input into its C input.The Q output of DFF1 510 (q1 signal state) is coupled to the D input(the data input) of a DFF2 520. The Q inverted output of DFF2 520 (q2 bsignal state) is coupled to a circuit 550. The output of the circuit 550is coupled to the D input of a DFF3 530. The Q output of DFF3 530 (q3signal state) is coupled to the D input of a DFF4 540. The outputs q1,q2, q3 and q4 can be selected by selectors 512, 522, 532, 542, therebyconfiguring the circuit 500 as a divide by 2, 4, 6 or 8 correctioncircuit.

A divider correction circuit 550 is coupled between the Q invertedoutput of DFF2 520 (q2 b) and the data input into DFF3 530. Asillustrated, divider correction circuit 550 is shown as a particulararrangement of p-type metal oxide semiconductor (PMOS) and n-type metaloxide semiconductor (NMOS) devices coupled between a supply voltage, Vddand ground. As is understood by those of skill in the art, the voltageproduced by a CMOS circuit is a function of a supply voltage, and whichtransistors of the CMOS circuit are turned on and off. Correctioncircuit 550 is one embodiment of logic implementing the truth table ofTable 1 below. One skilled in the art will understand that theparticular arrangement of PMOS/NMOS devices is exemplary and notintended to be limiting to only that arrangement.

TABLE 1 Truth Table for Correction Circuit 550. Q1b Q2b Q3b D3new 0 0 01 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 0

Table: CMOS Logic

In the above truth table, q1 b (inverted output of DFF1 510), q2 b(inverted output of DFF2 520), and q3 b (inverted output of DFF3 530)are employed. As shown in FIG. 5, the circuit 550 is coupled between theinverted output of q2 b and the data input into DFF3 530, designated asthe D3new value. Circuit 550 operates substantially as follows.

As shown in FIG. 5, the q1 b value, the q2 b value, and the q3 b valueare inputs into divider correction circuit 550. If q1 b is a zero, D3newequals the inverse of q2 b (i.e., D3new equals q2). Where q1 b is azero, the state of q3 or q3 b is not a factor in determining D3new.

However, if q1 b equals a one, and if q2 b equals a zero, and if q3 bequals zero, then D3new is set to equal one. If q1 b equals a one, andeither q2 b or q3 b also equal a one, D3new is set to equal zero. Hence,error correction arises.

Furthermore, there is no state among the desired states that wouldcreate a “skip” to an undesired state. For instance, if q1 and q3 equalzero of a desired state, this would be x 0 xxx 0 xx By definition of thetruth table of FIG. 5, this would then become x 0 x 0 x 0 xx. In otherwords, if q1 and q3 are zero, then q2 is automatically zero. Thus, thereis no state that creates a problem.

Turning now to FIG. 6, illustrated are simulated waveform diagram of theoperation of the diagram. As is illustrated, even if a q1 to q4 waveformstarts out in an incorrect state, it transitions into a correct sequenceof 1s and 0s after a few clock transitions.

It is understood that the present invention can take many forms andembodiments. Accordingly, several variations may be made in theforegoing without departing from the spirit or the scope of theinvention. The capabilities outlined herein allow for the possibility ofa variety of programming models. This disclosure should not be read aspreferring any particular programming model, but is instead directed tothe underlying mechanisms on which these programming models can bebuilt.

Having thus described the present invention by reference to certain ofits preferred embodiments, it is noted that the embodiments disclosedare illustrative rather than limiting in nature and that a wide range ofvariations, modifications, changes, and substitutions are contemplatedin the foregoing disclosure and, in some instances, some features of thepresent invention may be employed without a corresponding use of theother features. Many such variations and modifications may be considereddesirable by those skilled in the art based upon a review of theforegoing description of preferred embodiments. Accordingly, it isappropriate that the appended claims be construed broadly and in amanner consistent with the scope of the invention.

1. A method for state correction in a frequency divider state circuit,comprising: identifying a plurality of pre-determined desired statesfollowing an ordered sequence according to a pre-determined transitionrule; identifying a plurality of pre-determined undesired statesfollowing an ordered sequence according to the pre-determined transitionrule; selecting at least one of the plurality of pre-determinedundesired states; correlating the selected at least one of the pluralityof pre-determined undesired states with one of the plurality ofpre-determined desired states; and transitioning from the selectedundesired state to the correlated desired state, and not to the nextundesired state according to the pre-determined transition rule.
 2. Themethod of claim 1, further comprising: selecting at least two of theplurality of pre-determined undesired states; correlating each of the atleast two of the plurality of pre-determined undesired states with aunique one of the plurality of pre-determined desired states; andtransitioning from one of the at least two selected undesired states tothe desired state correlated to that selected undesired state, and notto the next undesired state according to the pre-determined transitionrule.
 3. The method of claim 1, wherein the pre-determined transitionrule comprises: a bitwise right circular shift operation; and wherein arightmost bit is inverted as it is transferred into a leftmost positionas a result of the right circular shift operation.
 4. A computer programproduct for state correction in a frequency divider state circuit, thecomputer program product having a computer-readable medium with acomputer program embodied thereon, the computer program comprising:computer code for identifying a plurality of pre-determined desiredstates following an ordered sequence according to a pre-determinedtransition rule; computer code for identifying a plurality ofpre-determined undesired states following an ordered sequence accordingto the pre-determined transition rule; computer code for selecting atleast one of the plurality of pre-determined undesired states; computercode for correlating the selected at least one of the plurality ofpre-determined undesired states with one of the plurality ofpre-determined desired states; and computer code for transitioning fromthe selected undesired state to the correlated desired state, and not tothe next undesired state according to the pre-determined transitionrule.
 5. The computer program product of claim 4, further comprising:computer code for selecting at least two of the plurality ofpre-determined undesired states; computer code for correlating each ofthe at least two of the plurality of pre-determined undesired stateswith a unique one of the plurality of pre-determined desired states; andcomputer code for transitioning from one of the at least two selectedundesired states to the desired state correlated to that selectedundesired state, and not to the next undesired state according to thepre-determined transition rule.
 6. The computer program product of claim4, wherein the pre-determined transition rule comprises: a bitwise rightcircular shift operation; and wherein a rightmost bit is inverted as itis transferred into a leftmost position as a result of the rightcircular shift operation.